import 'dart:ui';

import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'location_method_channel.dart';
import 'types.dart';

abstract class LocationPlatform extends PlatformInterface {
  /// Constructs a LocationPlatform.
  LocationPlatform() : super(token: _token);

  static final Object _token = Object();

  static LocationPlatform _instance = MethodChannelLocation();

  /// The default instance of [LocationPlatform] to use.
  ///
  /// Defaults to [MethodChannelLocation].
  static LocationPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [LocationPlatform] when
  /// they register themselves.
  static set instance(LocationPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<bool> changeSettings({
    LocationAccuracy? accuracy,
    LocationScenario? scenario,
    int? interval,
    double? distanceFilter,
    double? distanceInterval,
  }) {
    throw UnimplementedError();
  }

  /// Checks if service is enabled in the background mode.
  Future<bool> isBackgroundModeEnabled() {
    throw UnimplementedError();
  }

  /// Enables or disables service in the background mode.
  Future<bool> enableBackgroundMode({bool? enable}) {
    throw UnimplementedError();
  }

  /// Gets the current location of the user.
  ///
  /// Throws an error if the app has no permission to access location.
  /// Returns a [LocationData] object.
  Future<LocationData> getLocation() {
    throw UnimplementedError();
  }

  Future<GeoAddress> getGeoAddress() {
    throw UnimplementedError();
  }

  /// Checks if the app has permission to access location.
  ///
  /// If the result is [PermissionStatus.deniedForever], no dialog will be
  /// shown on [requestPermission].
  /// Returns a [PermissionStatus] object.
  Future<PermissionStatus> hasPermission() {
    throw UnimplementedError();
  }

  /// Requests permission to access location.
  ///
  /// If the result is [PermissionStatus.deniedForever], no dialog will be
  /// shown on [requestPermission].
  /// Returns a [PermissionStatus] object.
  Future<PermissionStatus> requestPermission() {
    throw UnimplementedError();
  }

  /// Checks if the location service is enabled.
  Future<bool> serviceEnabled() {
    throw UnimplementedError();
  }

  /// Request the activation of the location service.
  Future<bool> requestService() {
    throw UnimplementedError();
  }

  /// Returns a stream of [LocationData] objects.
  /// The frequency and accuracy of this stream can be changed with
  /// [changeSettings]
  ///
  /// Throws an error if the app has no permission to access location.
  Stream<LocationData> get onLocationChanged {
    throw UnimplementedError();
  }

  /// Change options of sticky background notification.
  Future<NotificationData?> changeNotificationOptions({
    String? channelName,
    String? title,
    String? iconName,
    String? subtitle,
    String? description,
    Color? color,
    bool? onTapBringToFront,
  }) {
    throw UnimplementedError();
  }

}
